<!--顶部 开始-->
<div id="top_main">
    <div id="top">
        <div id="top_1">
            {if $auth->isLogin()}
                <span class="MemberName">{$user->username}</span>
                <a href="/index/user/logout" target="_self">[ {:__l('index','Sign out')} ]</a>
            {else/}
                <a href="/index/user/login" target="_self">[ {:__l('index','Sign in')} ]&nbsp;</a>
            {/if}
        </div>
        <div id="top_2">
            <a href="{:addon_url('official/web.official_home/set_language')}?language=2&url={:base64_encode(request()->domain().request()->url())}" target="_self">简体中文&nbsp;</a>
            <a href="{:addon_url('official/web.official_home/set_language')}?language=1&url={:base64_encode(request()->domain().request()->url())}" target="_self">English</a>
        </div>
    </div>
</div>
<!--顶部 结束-->
<!--Logo 开始-->
<div id="logo_main">
    <div id="logo">
        <!--网站Logo 开始-->
        <div class="WebLogo">
            <a href="{:addon_url('official/web.official_home/index')}" target="_self">
                <img src="{:__config('site_logo','value')}" title="{:__config('basic_title')}" alt="{:__config('basic_title')}">
            </a>
        </div>
        <!--网站Logo 结束-->
        <!--导航 开始-->
        <div id="navigation">
            <ul class="navigationlist">
                <li>
                    <a href="{:addon_url('official/web.official_home/index')}" target="_self" {if empty(input('param.pid'))} class="current" {/if}>{:__l('index','Website homepage')}</a>
                </li>
                {if count($all_official_category)}
                    {foreach $all_official_category as $val}
                        {if $val['is_nav_show']}
                            <li>
                                <a href="{:get_cate_url($val)}" target="_self" {if (null !== input('param.pid')) && input('param.pid') == $val['id']} class="current" {/if} >{:ze($val,'name')}</a>
                                {if count($val['son'])}
                                    <ul class="subnavigationlist">
                                        {foreach $val['son'] as $son}
                                            {if $son['is_nav_show']}
                                                <li>
                                                    <a href="{:get_cate_url($son)}" target="_self">{:ze($son,'name')}</a>
                                                </li>
                                            {/if}
                                        {/foreach}
                                    </ul>
                                {/if}
                            </li>
                        {/if}
                    {/foreach}
                {/if}
            </ul>
        </div>
        <!--导航 结束-->
    </div>
</div>
<!--Logo 结束-->
<!--JS幻灯片 开始-->
<div id="banner_main">
    <!--幻灯片 开始-->
    <div id="banner">
        <ul class="bannerlist">
            {foreach $banners as $item}
                <li style="background:#fff; ">
                    <a {if $item['url']} href="{$item['url']}" target="_blank" {else/} href="javascript:;" {/if}>
                        <img src="{$item['image']}" height="500px" width="100%">
                    </a>
                </li>
            {/foreach}
        </ul>
    </div>
    <div class="hd">
        <ul></ul>
    </div>
    <!--幻灯片 结束-->
</div>
<script>
    if ($(".bannerlist li").length > 0) {
        $('#banner_main').slide({
            titCell: '.hd ul',
            mainCell: '#banner ul',
            autoPlay: true,
            autoPage: true,
            delayTime: 500,
            effect: 'left'
        });
        $(window).resize(function () {
            CenterBanner();
        });
        $(document).ready(function (e) {
            CenterBanner();
        });
    } else {
        $("#banner_main").hide();
    }

    function CenterBanner() {
        var imgWidth = parseInt($(".bannerlist li img:first").width());
        if (imgWidth <= 0) return;
        var winWidth = parseInt($(window).width());
        var offset = parseInt((winWidth - imgWidth) / 2);
        $(".bannerlist li img").css("margin-left", offset + 'px');
    }
</script>
<!--JS幻灯片 结束-->